﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using C1.Win.C1Input;
    using Excel;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Reflection;
    using System.Runtime.CompilerServices;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_RptBangKeDoanhThuChiPHi : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("CmdExel")]
        private System.Windows.Forms.Button _CmdExel;
        [AccessedThroughProperty("CmdExit")]
        private System.Windows.Forms.Button _CmdExit;
        [AccessedThroughProperty("CmdLoad")]
        private System.Windows.Forms.Button _CmdLoad;
        [AccessedThroughProperty("Label1")]
        private System.Windows.Forms.Label _Label1;
        [AccessedThroughProperty("Label13")]
        private System.Windows.Forms.Label _Label13;
        [AccessedThroughProperty("Label2")]
        private System.Windows.Forms.Label _Label2;
        [AccessedThroughProperty("Label3")]
        private System.Windows.Forms.Label _Label3;
        [AccessedThroughProperty("Label4")]
        private System.Windows.Forms.Label _Label4;
        [AccessedThroughProperty("Label5")]
        private System.Windows.Forms.Label _Label5;
        [AccessedThroughProperty("Label6")]
        private System.Windows.Forms.Label _Label6;
        [AccessedThroughProperty("Panel1")]
        private Panel _Panel1;
        [AccessedThroughProperty("Panel2")]
        private Panel _Panel2;
        [AccessedThroughProperty("TKChiPhi")]
        private System.Windows.Forms.TextBox _TKChiPhi;
        [AccessedThroughProperty("TKDoanhThu")]
        private System.Windows.Forms.TextBox _TKDoanhThu;
        [AccessedThroughProperty("TxtDenNgay")]
        private DateTimePicker _TxtDenNgay;
        [AccessedThroughProperty("TxtLoiNhuan")]
        private C1NumericEdit _TxtLoiNhuan;
        [AccessedThroughProperty("TxtTongChiPhi")]
        private C1NumericEdit _TxtTongChiPhi;
        [AccessedThroughProperty("TxtTongDoanhThu")]
        private C1NumericEdit _TxtTongDoanhThu;
        [AccessedThroughProperty("TxtTuNgay")]
        private DateTimePicker _TxtTuNgay;
        [AccessedThroughProperty("VSlist")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSlist;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;

        [DebuggerNonUserCode]
        public Frm_RptBangKeDoanhThuChiPHi()
        {
            base.Load += new EventHandler(this.Frm_RptBangKeDoanhThuChiPHi_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.InitializeComponent();
        }

        private void CmdExel_Click(object sender, EventArgs e)
        {
            try
            {
                SaveFileDialog dialog = new SaveFileDialog {
                    Filter = "Excel Files|*.xls",
                    Title = "Save an Excel file"
                };
                dialog.ShowDialog();
                if (dialog.FileName != "")
                {
                    this.VSlist.SaveExcel(dialog.FileName, "DOANHTHU-CHIPHI", FileFlags.IncludeFixedCells);
                    Excel.Application application = new ApplicationClass();
                    Workbook workbook = application.Workbooks.Open(dialog.FileName, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
                    application.Visible = true;
                }
            }
            catch (COMException exception1)
            {
                ProjectData.SetProjectError(exception1);
                COMException exception = exception1;
                MessageBox.Show(exception.Message);
                ProjectData.ClearProjectError();
            }
            catch (Exception exception3)
            {
                ProjectData.SetProjectError(exception3);
                Exception exception2 = exception3;
                MessageBox.Show(exception2.Message);
                ProjectData.ClearProjectError();
            }
        }

        private void CmdExit_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdLoad_Click(object sender, EventArgs e)
        {
            this.LoadData();
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (disposing && (this.components != null))
                {
                    this.components.Dispose();
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }

        private void Frm_RptBangKeDoanhThuChiPHi_Load(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.TKDoanhThu.Text = "511,512,515,711";
                this.TKChiPhi.Text = "635,641,642,632,811,631,630,812,821";
                LVYModule.advFormatNumber(this.TxtTongDoanhThu, modGeneral.H_FORMATNUMBER);
                LVYModule.advFormatNumber(this.TxtTongChiPhi, modGeneral.H_FORMATNUMBER);
                LVYModule.advFormatNumber(this.TxtLoiNhuan, modGeneral.H_FORMATNUMBER);
                this.LoadData();
                this.Cursor = Cursors.Default;
            }
        }

        public System.Data.DataTable GetData()
        {
            System.Data.DataTable table;
            IDataParameter[] commandParameters = new IDataParameter[6];
            try
            {
                commandParameters[0] = DBHelper.createParameter("@KhoaDonVi", DbType.Int64, ParameterDirection.Input, modGeneral.H_CLIENT);
                commandParameters[1] = DBHelper.createParameter("@TuNgay", DbType.Int64, ParameterDirection.Input, LVYModule.Date2Char(this.TxtTuNgay.Text));
                commandParameters[2] = DBHelper.createParameter("@DenNgay", DbType.Int64, ParameterDirection.Input, LVYModule.Date2Char(this.TxtDenNgay.Text));
                commandParameters[3] = DBHelper.createParameter("@ListTKDoanhThu", DbType.Int64, ParameterDirection.Input, this.TKDoanhThu.Text.Trim());
                commandParameters[4] = DBHelper.createParameter("@ListTKChiPhi", DbType.Int64, ParameterDirection.Input, this.TKChiPhi.Text.Trim());
                commandParameters[5] = DBHelper.createParameter("@Language", DbType.Int64, ParameterDirection.Input, modGeneral.H_LANGUAGE);
                table = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.StoredProcedure, "GL_BC_BangKeDoanhThuChiPhi", commandParameters).Tables[0];
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                table = null;
                ProjectData.ClearProjectError();
                return table;
                ProjectData.ClearProjectError();
            }
            return table;
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_RptBangKeDoanhThuChiPHi));
            this.Panel1 = new Panel();
            this.CmdLoad = new System.Windows.Forms.Button();
            this.CmdExel = new System.Windows.Forms.Button();
            this.Label3 = new System.Windows.Forms.Label();
            this.Label2 = new System.Windows.Forms.Label();
            this.TKChiPhi = new System.Windows.Forms.TextBox();
            this.TKDoanhThu = new System.Windows.Forms.TextBox();
            this.Label1 = new System.Windows.Forms.Label();
            this.CmdExit = new System.Windows.Forms.Button();
            this.TxtTuNgay = new DateTimePicker();
            this.Label13 = new System.Windows.Forms.Label();
            this.TxtDenNgay = new DateTimePicker();
            this.VSlist = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.Panel2 = new Panel();
            this.Label6 = new System.Windows.Forms.Label();
            this.TxtLoiNhuan = new C1NumericEdit();
            this.Label5 = new System.Windows.Forms.Label();
            this.TxtTongChiPhi = new C1NumericEdit();
            this.Label4 = new System.Windows.Forms.Label();
            this.TxtTongDoanhThu = new C1NumericEdit();
            this.Panel1.SuspendLayout();
            this.VSlist.BeginInit();
            this.Panel2.SuspendLayout();
            ((ISupportInitialize) this.TxtLoiNhuan).BeginInit();
            ((ISupportInitialize) this.TxtTongChiPhi).BeginInit();
            ((ISupportInitialize) this.TxtTongDoanhThu).BeginInit();
            this.SuspendLayout();
            this.Panel1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel1.Controls.Add(this.CmdLoad);
            this.Panel1.Controls.Add(this.CmdExel);
            this.Panel1.Controls.Add(this.Label3);
            this.Panel1.Controls.Add(this.Label2);
            this.Panel1.Controls.Add(this.TKChiPhi);
            this.Panel1.Controls.Add(this.TKDoanhThu);
            this.Panel1.Controls.Add(this.Label1);
            this.Panel1.Controls.Add(this.CmdExit);
            this.Panel1.Controls.Add(this.TxtTuNgay);
            this.Panel1.Controls.Add(this.Label13);
            this.Panel1.Controls.Add(this.TxtDenNgay);
            this.Panel1.Dock = DockStyle.Top;
            System.Drawing.Point point = new System.Drawing.Point(0, 0);
            this.Panel1.Location = point;
            this.Panel1.Name = "Panel1";
            Size size = new Size(0x37e, 0x2d);
            this.Panel1.Size = size;
            this.Panel1.TabIndex = 1;
            this.CmdLoad.Image = (Image) manager.GetObject("CmdLoad.Image");
            this.CmdLoad.ImageAlign = ContentAlignment.MiddleLeft;
            point = new System.Drawing.Point(680, 0x10);
            this.CmdLoad.Location = point;
            this.CmdLoad.Name = "CmdLoad";
            size = new Size(70, 0x19);
            this.CmdLoad.Size = size;
            this.CmdLoad.TabIndex = 0x9f;
            this.CmdLoad.Text = "Load";
            this.CmdLoad.UseVisualStyleBackColor = true;
            this.CmdExel.Image = (Image) manager.GetObject("CmdExel.Image");
            this.CmdExel.ImageAlign = ContentAlignment.MiddleLeft;
            point = new System.Drawing.Point(0x2ef, 0x10);
            this.CmdExel.Location = point;
            this.CmdExel.Name = "CmdExel";
            size = new Size(70, 0x19);
            this.CmdExel.Size = size;
            this.CmdExel.TabIndex = 160;
            this.CmdExel.Text = "&Excel";
            this.CmdExel.UseVisualStyleBackColor = true;
            this.Label3.AutoSize = true;
            this.Label3.BackColor = Color.Transparent;
            this.Label3.ForeColor = Color.Black;
            point = new System.Drawing.Point(0x1a8, 4);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            size = new Size(0x3a, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 0x9e;
            this.Label3.Text = "TK Chi ph\x00ed";
            this.Label2.AutoSize = true;
            this.Label2.BackColor = Color.Transparent;
            this.Label2.ForeColor = Color.Black;
            point = new System.Drawing.Point(170, 4);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(0x4a, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 0x9d;
            this.Label2.Text = "TK Doanh thu";
            point = new System.Drawing.Point(0x1a7, 20);
            this.TKChiPhi.Location = point;
            this.TKChiPhi.Name = "TKChiPhi";
            size = new Size(250, 20);
            this.TKChiPhi.Size = size;
            this.TKChiPhi.TabIndex = 0x9c;
            point = new System.Drawing.Point(0xab, 20);
            this.TKDoanhThu.Location = point;
            this.TKDoanhThu.Name = "TKDoanhThu";
            size = new Size(0xf9, 20);
            this.TKDoanhThu.Size = size;
            this.TKDoanhThu.TabIndex = 0x9b;
            this.Label1.AutoSize = true;
            this.Label1.BackColor = Color.Transparent;
            this.Label1.ForeColor = Color.Black;
            point = new System.Drawing.Point(4, 4);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x2e, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 0x9a;
            this.Label1.Text = "Từ ng\x00e0y";
            this.CmdExit.Image = ACCOUNTING.My.Resources.Resources.Closed;
            this.CmdExit.ImageAlign = ContentAlignment.MiddleLeft;
            point = new System.Drawing.Point(0x336, 0x10);
            this.CmdExit.Location = point;
            this.CmdExit.Name = "CmdExit";
            size = new Size(0x45, 0x19);
            this.CmdExit.Size = size;
            this.CmdExit.TabIndex = 0x99;
            this.CmdExit.Text = "Th&o\x00e1t";
            this.CmdExit.UseVisualStyleBackColor = true;
            this.TxtTuNgay.Format = DateTimePickerFormat.Short;
            point = new System.Drawing.Point(7, 20);
            this.TxtTuNgay.Location = point;
            this.TxtTuNgay.Name = "TxtTuNgay";
            size = new Size(0x4e, 20);
            this.TxtTuNgay.Size = size;
            this.TxtTuNgay.TabIndex = 0x94;
            this.Label13.AutoSize = true;
            this.Label13.BackColor = Color.Transparent;
            this.Label13.ForeColor = Color.Black;
            point = new System.Drawing.Point(0x54, 4);
            this.Label13.Location = point;
            this.Label13.Name = "Label13";
            size = new Size(0x35, 13);
            this.Label13.Size = size;
            this.Label13.TabIndex = 0x25;
            this.Label13.Text = "Đến ng\x00e0y";
            this.TxtDenNgay.Format = DateTimePickerFormat.Short;
            point = new System.Drawing.Point(0x58, 20);
            this.TxtDenNgay.Location = point;
            this.TxtDenNgay.Name = "TxtDenNgay";
            size = new Size(0x4e, 20);
            this.TxtDenNgay.Size = size;
            this.TxtDenNgay.TabIndex = 0x24;
            this.VSlist.AllowEditing = false;
            this.VSlist.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.XpThemes;
            this.VSlist.ColumnInfo = manager.GetString("VSlist.ColumnInfo");
            this.VSlist.Dock = DockStyle.Fill;
            this.VSlist.ExtendLastCol = true;
            this.VSlist.FocusRect = FocusRectEnum.None;
            this.VSlist.KeyActionEnter = KeyActionEnum.MoveAcross;
            point = new System.Drawing.Point(0, 0x2d);
            this.VSlist.Location = point;
            this.VSlist.Name = "VSlist";
            this.VSlist.Rows.Count = 1;
            this.VSlist.Rows.DefaultSize = 0x11;
            this.VSlist.Rows.MaxSize = 0x12;
            this.VSlist.Rows.MinSize = 0x12;
            this.VSlist.SelectionMode = SelectionModeEnum.Row;
            size = new Size(0x37e, 0x1e5);
            this.VSlist.Size = size;
            this.VSlist.StyleInfo = manager.GetString("VSlist.StyleInfo");
            this.VSlist.TabIndex = 0x80;
            this.VSlist.VisualStyle = C1.Win.C1FlexGrid.VisualStyle.Office2007Blue;
            this.Panel2.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel2.Controls.Add(this.Label6);
            this.Panel2.Controls.Add(this.TxtLoiNhuan);
            this.Panel2.Controls.Add(this.Label5);
            this.Panel2.Controls.Add(this.TxtTongChiPhi);
            this.Panel2.Controls.Add(this.Label4);
            this.Panel2.Controls.Add(this.TxtTongDoanhThu);
            this.Panel2.Dock = DockStyle.Bottom;
            point = new System.Drawing.Point(0, 530);
            this.Panel2.Location = point;
            this.Panel2.Name = "Panel2";
            size = new Size(0x37e, 0x2d);
            this.Panel2.Size = size;
            this.Panel2.TabIndex = 0x81;
            this.Label6.AutoEllipsis = true;
            this.Label6.AutoSize = true;
            this.Label6.BackColor = Color.Transparent;
            point = new System.Drawing.Point(0x30e, 0x1a);
            this.Label6.Location = point;
            this.Label6.Name = "Label6";
            this.Label6.RightToLeft = RightToLeft.No;
            size = new Size(0x36, 13);
            this.Label6.Size = size;
            this.Label6.TabIndex = 0x90;
            this.Label6.Text = "Lợi nhuận";
            this.Label6.TextAlign = ContentAlignment.TopRight;
            this.TxtLoiNhuan.BorderStyle = BorderStyle.FixedSingle;
            this.TxtLoiNhuan.DataType = typeof(double);
            this.TxtLoiNhuan.FormatType = FormatTypeEnum.Currency;
            point = new System.Drawing.Point(0x311, 3);
            this.TxtLoiNhuan.Location = point;
            this.TxtLoiNhuan.Name = "TxtLoiNhuan";
            Padding padding = new Padding(1);
            this.TxtLoiNhuan.Padding = padding;
            this.TxtLoiNhuan.ReadOnly = true;
            size = new Size(0x68, 20);
            this.TxtLoiNhuan.Size = size;
            this.TxtLoiNhuan.TabIndex = 0x8f;
            this.TxtLoiNhuan.Tag = null;
            this.TxtLoiNhuan.TextAlign = HorizontalAlignment.Right;
            this.TxtLoiNhuan.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtLoiNhuan.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtLoiNhuan.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label5.AutoEllipsis = true;
            this.Label5.AutoSize = true;
            this.Label5.BackColor = Color.Transparent;
            point = new System.Drawing.Point(0x2a3, 0x1a);
            this.Label5.Location = point;
            this.Label5.Name = "Label5";
            this.Label5.RightToLeft = RightToLeft.No;
            size = new Size(0x47, 13);
            this.Label5.Size = size;
            this.Label5.TabIndex = 0x8e;
            this.Label5.Text = "Tổng chi  ph\x00ed";
            this.Label5.TextAlign = ContentAlignment.TopRight;
            this.TxtTongChiPhi.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongChiPhi.DataType = typeof(double);
            this.TxtTongChiPhi.FormatType = FormatTypeEnum.Currency;
            point = new System.Drawing.Point(0x2a6, 3);
            this.TxtTongChiPhi.Location = point;
            this.TxtTongChiPhi.Name = "TxtTongChiPhi";
            padding = new Padding(1);
            this.TxtTongChiPhi.Padding = padding;
            this.TxtTongChiPhi.ReadOnly = true;
            size = new Size(0x68, 20);
            this.TxtTongChiPhi.Size = size;
            this.TxtTongChiPhi.TabIndex = 0x8d;
            this.TxtTongChiPhi.Tag = null;
            this.TxtTongChiPhi.TextAlign = HorizontalAlignment.Right;
            this.TxtTongChiPhi.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTongChiPhi.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongChiPhi.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label4.AutoEllipsis = true;
            this.Label4.AutoSize = true;
            this.Label4.BackColor = Color.Transparent;
            point = new System.Drawing.Point(0x238, 0x1a);
            this.Label4.Location = point;
            this.Label4.Name = "Label4";
            this.Label4.RightToLeft = RightToLeft.No;
            size = new Size(0x53, 13);
            this.Label4.Size = size;
            this.Label4.TabIndex = 140;
            this.Label4.Text = "Tổng doanh thu";
            this.Label4.TextAlign = ContentAlignment.TopRight;
            this.TxtTongDoanhThu.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongDoanhThu.DataType = typeof(double);
            this.TxtTongDoanhThu.FormatType = FormatTypeEnum.Currency;
            point = new System.Drawing.Point(0x23b, 3);
            this.TxtTongDoanhThu.Location = point;
            this.TxtTongDoanhThu.Name = "TxtTongDoanhThu";
            padding = new Padding(1);
            this.TxtTongDoanhThu.Padding = padding;
            this.TxtTongDoanhThu.ReadOnly = true;
            size = new Size(0x68, 20);
            this.TxtTongDoanhThu.Size = size;
            this.TxtTongDoanhThu.TabIndex = 0x8b;
            this.TxtTongDoanhThu.Tag = null;
            this.TxtTongDoanhThu.TextAlign = HorizontalAlignment.Right;
            this.TxtTongDoanhThu.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTongDoanhThu.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongDoanhThu.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x37e, 0x23f);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.VSlist);
            this.Controls.Add(this.Panel2);
            this.Controls.Add(this.Panel1);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "Frm_RptBangKeDoanhThuChiPHi";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "BC-KT06";
            this.Text = "BANG KE DOANH THU CHI PHI";
            this.Panel1.ResumeLayout(false);
            this.Panel1.PerformLayout();
            this.VSlist.EndInit();
            this.Panel2.ResumeLayout(false);
            this.Panel2.PerformLayout();
            ((ISupportInitialize) this.TxtLoiNhuan).EndInit();
            ((ISupportInitialize) this.TxtTongChiPhi).EndInit();
            ((ISupportInitialize) this.TxtTongDoanhThu).EndInit();
            this.ResumeLayout(false);
        }

        public void LoadData()
        {
            this.Cursor = Cursors.WaitCursor;
            System.Data.DataTable data = this.GetData();
            double num3 = 0.0;
            double num2 = 0.0;
            C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
            vSlist.Rows.Count = 1;
            int num4 = data.Rows.Count - 1;
            for (int i = 0; i <= num4; i++)
            {
                vSlist.AddItem("");
                vSlist[vSlist.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(data.Rows[i]["LoaiPhatSinh"]);
                vSlist[vSlist.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(data.Rows[i]["SoTaiKhoan"]);
                vSlist[vSlist.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(data.Rows[i]["TenTaiKhoan"]);
                if (data.Rows[i]["Loai"].ToString().Trim() == "00")
                {
                    vSlist[vSlist.Rows.Count - 1, 6] = Conversion.Val(RuntimeHelpers.GetObjectValue(data.Rows[i]["SoPhatSinhCo"])) - Conversion.Val(RuntimeHelpers.GetObjectValue(data.Rows[i]["SoPhatSinhNo"]));
                    num3 += Conversion.Val(RuntimeHelpers.GetObjectValue(vSlist[vSlist.Rows.Count - 1, 6]));
                }
                else
                {
                    vSlist[vSlist.Rows.Count - 1, 6] = Conversion.Val(RuntimeHelpers.GetObjectValue(data.Rows[i]["SoPhatSinhNo"])) - Conversion.Val(RuntimeHelpers.GetObjectValue(data.Rows[i]["SoPhatSinhCo"]));
                    num2 += Conversion.Val(RuntimeHelpers.GetObjectValue(vSlist[vSlist.Rows.Count - 1, 6]));
                }
            }
            vSlist.Tree.Column = 2;
            vSlist.Subtotal(AggregateEnum.Sum, 0, 0, 0, 6, "{0}");
            vSlist = null;
            this.TxtTongDoanhThu.Value = num3;
            this.TxtTongChiPhi.Value = num2;
            this.TxtLoiNhuan.Value = num3 - num2;
            this.Cursor = Cursors.Default;
        }

        private void TxtTuNgay_LostFocus(object sender, EventArgs e)
        {
            if (LVYModule.sRight(this.TxtTuNgay.Text, 7) != LVYModule.sRight(this.TxtDenNgay.Text, 7))
            {
                this.TxtDenNgay.Text = DateTime.DaysInMonth(Conversions.ToInteger(LVYModule.sRight(this.TxtTuNgay.Text, 4)), Conversions.ToInteger(LVYModule.sMid(this.TxtTuNgay.Text, 4, 2))).ToString() + "/" + LVYModule.sRight(this.TxtTuNgay.Text, 7);
            }
        }

        internal virtual System.Windows.Forms.Button CmdExel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExel_Click);
                if (this._CmdExel != null)
                {
                    this._CmdExel.Click -= handler;
                }
                this._CmdExel = value;
                if (this._CmdExel != null)
                {
                    this._CmdExel.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Button CmdExit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExit_Click);
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click -= handler;
                }
                this._CmdExit = value;
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Button CmdLoad
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdLoad;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdLoad_Click);
                if (this._CmdLoad != null)
                {
                    this._CmdLoad.Click -= handler;
                }
                this._CmdLoad = value;
                if (this._CmdLoad != null)
                {
                    this._CmdLoad.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual System.Windows.Forms.Label Label13
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label13;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label13 = value;
            }
        }

        internal virtual System.Windows.Forms.Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual System.Windows.Forms.Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual System.Windows.Forms.Label Label4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label4 = value;
            }
        }

        internal virtual System.Windows.Forms.Label Label5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label5 = value;
            }
        }

        internal virtual System.Windows.Forms.Label Label6
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label6;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label6 = value;
            }
        }

        internal virtual Panel Panel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel1 = value;
            }
        }

        internal virtual Panel Panel2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel2 = value;
            }
        }

        internal virtual System.Windows.Forms.TextBox TKChiPhi
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TKChiPhi;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TKChiPhi = value;
            }
        }

        internal virtual System.Windows.Forms.TextBox TKDoanhThu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TKDoanhThu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TKDoanhThu = value;
            }
        }

        internal virtual DateTimePicker TxtDenNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDenNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDenNgay = value;
            }
        }

        internal virtual C1NumericEdit TxtLoiNhuan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtLoiNhuan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtLoiNhuan = value;
            }
        }

        internal virtual C1NumericEdit TxtTongChiPhi
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongChiPhi;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongChiPhi = value;
            }
        }

        internal virtual C1NumericEdit TxtTongDoanhThu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongDoanhThu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongDoanhThu = value;
            }
        }

        internal virtual DateTimePicker TxtTuNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTuNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtTuNgay_LostFocus);
                if (this._TxtTuNgay != null)
                {
                    this._TxtTuNgay.LostFocus -= handler;
                }
                this._TxtTuNgay = value;
                if (this._TxtTuNgay != null)
                {
                    this._TxtTuNgay.LostFocus += handler;
                }
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSlist
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSlist;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._VSlist = value;
            }
        }
    }
}

